package cn.bdqn.service.impl;

import cn.bdqn.domain.Recipe;
import cn.bdqn.mapper.RecipeMapper;
import cn.bdqn.service.RecipeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 处方表的业务接口实现
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class RecipeServiceImpl implements RecipeService {

    @Autowired
    private RecipeMapper recipeMapper;

    /**
     * 根据挂号id修改支付状态
     * @param regisId
     * @return
     */
    @Override
    @Transactional( rollbackFor =Exception.class ,propagation = Propagation.REQUIRES_NEW)
    public int updateByRegisId(String regisId) {
        return recipeMapper.updateByRegisId(regisId);
    }

    /**
     * 根据regisId查询处方信息
     * @param regisId
     * @return
     */
    @Override
    public Recipe queryByRegisId(String regisId) {
        return recipeMapper.selectByRegisId(regisId);
    }
}
